package com.itheima.demo;

import com.itheima.domain.Orders;
import com.itheima.utils.MapperUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class Demo1 {
    public static void main(String[] args) {
        //获取Sqlsession对象
        SqlSession session = MapperUtil.getsession();
        List<Orders> list = session.selectList("com.itheima.mapper.OrdersMapper.findAll2");
        for (Orders ou : list) {
//            System.out.println("订单编号：" + ou.getNumber() + "\t用户名称：" + ou.getUser().getUsername() + "\tuid:" + ou.getUser().getId());
            System.out.println("订单编号：" + ou.getNumber());
        }
        MapperUtil.close(session);
    }
}
